﻿using LINQ = JLL.China.Infrastructure.Repositories.LINQ2SQL;

namespace JLL.China.Infrastructure.Repositories.ListingFloorPlan
{
    public static class ListingFloorPlanRefactory
    {
        public static Model.ListingFloorPlan FromLINQObject(LINQ.ListingFloorPlan prj)
        {
            if (prj == null)
            {
                return null;
            }
            else
            {
                var model = new Model.ListingFloorPlan()
                {
                    ListingFloorPlan_ID = prj.ListingFloorPlan_ID,
                    TypeModel = prj.TypeModel,

                    NoUnit = prj.NoUnit,
                    FloorPlanImg = prj.FloorPlanImg,
                    ListingFID = prj.ListingFID,
                    LanguageFID = prj.LanguageFID
                };
                return model;
            }
        }

        public static LINQ.ListingFloorPlan ToLINQObject(Model.ListingFloorPlan prj)
        {
            var model = new LINQ.ListingFloorPlan()
            {
                ListingFloorPlan_ID = prj.ListingFloorPlan_ID,
                TypeModel = prj.TypeModel,

                NoUnit = prj.NoUnit,
                FloorPlanImg = prj.FloorPlanImg,
                ListingFID = prj.ListingFID,
                LanguageFID = prj.LanguageFID
            };
            return model;
        }
    }
}
